﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml.Linq;
using System.Xml;

/// <summary>
/// Summary description for ReadSomeFileXML
/// </summary>
public class ReadSomeFileXML
{
	public ReadSomeFileXML()
	{
		//
		// TODO: Add constructor logic here
		//
	}
    public static bool callAllowShowResultReportxHDgtgt()
    {
        bool rs = false;
        try
        {
            string path = HttpContext.Current.Server.MapPath(@"~/upload/xml");
            //string path = clsPublic.pagelink + "" + "/Upload/xml";
            //cls_tb_result.update(" "+path);

            string full_path = "" + path + "/allowShowResultTestRPxHDgtgt.xml";
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(full_path);

            XmlNodeList nodeList = xmlDoc.SelectNodes("/Root");

            // allowShowResultReportxHDgtgt
            //nodeList[0].ChildNodes[0].InnerText = "ASP.NET";
            string allow = nodeList[0].SelectSingleNode("allowShowResultReportxHDgtgt").InnerText;
            if (allow == "1")
            {
                rs = true;
                //cls_tb_result.update(" " + "true");
            }
            else
            {
                rs = false;
                //cls_tb_result.update(" " + "false");
            }
        }
        catch (Exception ex)
        {
            //cls_tb_result.update(" " + "Err=" + ex.Source);
        }
        return rs;
    }
    public static string getMessageInBCnganh()
    {
        string result = "";
        try
        {
            string path = HttpContext.Current.Server.MapPath(@"~/Upload/xml");
            string full_path = "" + path + "/MessageInBCnganh.xml";
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(full_path);

            XmlNodeList nodeList = xmlDoc.SelectNodes("/Root");

            // timelast
            //nodeList[0].ChildNodes[0].InnerText = "ASP.NET";
            string MessageInBCnganh = nodeList[0].SelectSingleNode("MessageInBCnganh").InnerText;
            result = (MessageInBCnganh);
        }
        catch
        {
             
        }
        return result;
    }
    public static string getMessageRoleBuilding()
    {
        string result = "";
        try
        {
            string path = HttpContext.Current.Server.MapPath(@"~/Upload/xml");
            string full_path = "" + path + "/MessageRoleBuilding.xml";
            XmlDocument xmlDoc = new XmlDocument();
            xmlDoc.Load(full_path);

            XmlNodeList nodeList = xmlDoc.SelectNodes("/Root");

            // timelast
            //nodeList[0].ChildNodes[0].InnerText = "ASP.NET";
            string Message = nodeList[0].SelectSingleNode("MessageRoleBuilding").InnerText;
            result = (Message);
        }
        catch
        {

        }
        return result;
    }
}